import store from '@/store'
export function oldLoginSystem(redirectUrl,url) {  
    const { userno, token } = store.getters.userInfo
    let sum = localStorage.getItem('oldloginSum') 

    //第一次点击跳转到旧系统的时候用本地存储跳转次数 大于1就不需要中转路径则直接跳转
    if(sum  && sum >= 1 ) {
        window.open(redirectUrl, '_blank')
    } else { 
        localStorage.setItem('oldloginSum', 1) 
        const URL = 'http://jx.qida999.com/DriverCommon/CommApiNew/login/Login.aspx' + `?userno=${userno}&token=${token}&redirectUrl=${redirectUrl}`
        window.open(URL, '_blank')
    }
    /* 
    
        const { userno,token } =store.getters.userInfo
        最终跳转路径 encodeURIComponent()二进制编码  详解：https://www.yzktw.com.cn/post/1597942.html
        const redirectUrl = encodeURIComponent('http://jx.qida999.com/DriverCommon/driver/dr_car.html?car=%E7%B2%A4L0001%E5%AD%A6&aid=101&ver=1700711075413')
        中转路径
        const url = `http://jx.qida999.com/DriverCommon/CommApiNew/login/Login.aspx?userno=${userno}&token=${token}&redirectUrl=${redirectUrl}`
        window.open(url, '_blank')
    */

}